package com.atguigu.gulimall.order.vo;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class OrderItemVo {

    private Long skuId;
    //private Boolean check=true;
    private String title;
    private String image;
    private List<String> skuAttrValues;
    private BigDecimal price;
    private Integer count;
    private BigDecimal totalPrice;

    //TODO 需要查询库存系统检查是否有库存
    private Boolean hasStock = true;

    //商品的重量信息，涉及运费计算等，本系统没考虑，就不用管了，前端设置固定值即可
    private BigDecimal weight;

    /**
     * 据说这样写不会被Lombok覆盖
     * @return
     */
    public BigDecimal getTotalPrice() {
        return price.multiply(BigDecimal.valueOf(count));
    }


}
